<template>
	<view class="container">
		<!-- 顶部状态栏 -->
		<view class="status-bar">
			<text class="time">9:41</text>
			<view class="status-icons">
				<view class="icon-dot"></view>
				<view class="icon-dot"></view>
			</view>
		</view>

		<!-- 头部标题 -->
		<view class="header">
			<text class="header-title">个人中心</text>
			<view class="header-actions">
				<view class="action-icon">⋯</view>
				<view class="action-icon">●</view>
			</view>
		</view>

		<!-- 用户信息卡片 -->
		<view class="user-card">
			<view class="user-avatar">
				<view class="avatar-placeholder"></view>
			</view>
			<view class="user-info">
				<text class="user-name">用户姓名</text>
				<text class="user-id">就诊卡号：123456789</text>
			</view>
		</view>

		<!-- 功能菜单 -->
		<view class="menu-section">
			<view class="menu-item" v-for="(item, index) in menuItems" :key="index" @click="handleMenuClick(item)">
				<view class="menu-icon" :style="{ backgroundColor: item.color }"></view>
				<text class="menu-text">{{ item.name }}</text>
				<view class="menu-arrow">></view>
			</view>
		</view>

		<!-- 底部导航 -->
		<view class="bottom-nav">
			<view class="nav-item" @click="goToHome">
				<view class="nav-icon nav-icon-home"></view>
				<text class="nav-text">首页</text>
			</view>
			<view class="nav-item nav-item-active">
				<view class="nav-icon nav-icon-person"></view>
				<text class="nav-text">个人中心</text>
			</view>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			menuItems: [
				{ name: '我的预约', color: '#4A90E2', id: 'my_appointments' },
				{ name: '就诊记录', color: '#4CAF50', id: 'medical_records' },
				{ name: '我的报告', color: '#FF9800', id: 'my_reports' },
				{ name: '我的发票', color: '#9C27B0', id: 'my_invoices' },
				{ name: '账户设置', color: '#607D8B', id: 'account_settings' },
				{ name: '帮助中心', color: '#795548', id: 'help_center' }
			]
		}
	},
	methods: {
		handleMenuClick(item) {
			uni.showToast({
				title: `点击了${item.name}`,
				icon: 'none'
			})
			console.log('点击菜单:', item)
		},
		goToHome() {
			uni.navigateBack()
		}
	}
}
</script>

<style scoped>
.container {
	min-height: 100vh;
	background-color: #f5f5f5;
	padding-bottom: 120rpx;
}

/* 顶部状态栏 */
.status-bar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 20rpx 30rpx;
	background-color: #ffffff;
}

.time {
	font-size: 28rpx;
	color: #333;
	font-weight: 500;
}

.status-icons {
	display: flex;
	gap: 10rpx;
}

.icon-dot {
	width: 8rpx;
	height: 8rpx;
	background-color: #333;
	border-radius: 50%;
}

/* 头部标题 */
.header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 20rpx 30rpx;
	background-color: #ffffff;
	border-bottom: 1rpx solid #f0f0f0;
}

.header-title {
	font-size: 36rpx;
	font-weight: bold;
	color: #333;
}

.header-actions {
	display: flex;
	gap: 20rpx;
}

.action-icon {
	width: 40rpx;
	height: 40rpx;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 24rpx;
	color: #666;
}

/* 用户信息卡片 */
.user-card {
	margin: 30rpx;
	background-color: #ffffff;
	border-radius: 20rpx;
	padding: 40rpx;
	display: flex;
	align-items: center;
}

.user-avatar {
	margin-right: 30rpx;
}

.avatar-placeholder {
	width: 120rpx;
	height: 120rpx;
	background-color: #4A90E2;
	border-radius: 50%;
	opacity: 0.8;
}

.user-info {
	flex: 1;
}

.user-name {
	font-size: 36rpx;
	font-weight: bold;
	color: #333;
	margin-bottom: 10rpx;
	display: block;
}

.user-id {
	font-size: 28rpx;
	color: #666;
	display: block;
}

/* 功能菜单 */
.menu-section {
	margin: 30rpx;
	background-color: #ffffff;
	border-radius: 20rpx;
	overflow: hidden;
}

.menu-item {
	display: flex;
	align-items: center;
	padding: 30rpx;
	border-bottom: 1rpx solid #f0f0f0;
	transition: all 0.3s ease;
}

.menu-item:last-child {
	border-bottom: none;
}

.menu-item:active {
	background-color: #f8f9fa;
}

.menu-icon {
	width: 60rpx;
	height: 60rpx;
	border-radius: 50%;
	margin-right: 30rpx;
}

.menu-text {
	flex: 1;
	font-size: 32rpx;
	color: #333;
}

.menu-arrow {
	font-size: 32rpx;
	color: #ccc;
}

/* 底部导航 */
.bottom-nav {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	height: 120rpx;
	background-color: #ffffff;
	display: flex;
	align-items: center;
	justify-content: space-around;
	border-top: 1rpx solid #f0f0f0;
	padding-bottom: 20rpx;
}

.nav-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 10rpx 20rpx;
	border-radius: 12rpx;
	transition: all 0.3s ease;
}

.nav-item:active {
	background-color: #f8f9fa;
}

.nav-icon {
	width: 48rpx;
	height: 48rpx;
	margin-bottom: 8rpx;
	border-radius: 50%;
}

.nav-icon-home {
	background-color: #333;
	position: relative;
}

.nav-icon-home::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 24rpx;
	height: 24rpx;
	background-color: #ffffff;
	border-radius: 50%;
}

.nav-icon-person {
	background-color: #4A90E2;
	position: relative;
}

.nav-icon-person::before {
	content: '';
	position: absolute;
	top: 30%;
	left: 50%;
	transform: translateX(-50%);
	width: 20rpx;
	height: 20rpx;
	background-color: #ffffff;
	border-radius: 50%;
}

.nav-icon-person::after {
	content: '';
	position: absolute;
	bottom: 20%;
	left: 50%;
	transform: translateX(-50%);
	width: 32rpx;
	height: 16rpx;
	background-color: #ffffff;
	border-radius: 8rpx;
}

.nav-text {
	font-size: 24rpx;
	color: #666;
}

.nav-item-active .nav-text {
	color: #4A90E2;
	font-weight: bold;
}

/* 响应式适配 */
@media screen and (max-width: 600rpx) {
	.user-card {
		padding: 30rpx;
	}
	
	.avatar-placeholder {
		width: 100rpx;
		height: 100rpx;
	}
	
	.user-name {
		font-size: 32rpx;
	}
	
	.user-id {
		font-size: 26rpx;
	}
}

/* 安全区域适配 */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
	.container {
		padding-bottom: calc(120rpx + env(safe-area-inset-bottom));
	}
	
	.bottom-nav {
		padding-bottom: calc(20rpx + env(safe-area-inset-bottom));
	}
}
</style> 